package com.jumlabs.data.repositories.drive;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.jumlabs.data.entities.drive.File;

public interface FileRepository extends JpaRepository<File, Long> {
	
	@Query("select f from File f where f.drive.id=:driveId and f.parent=null")
	List<File> findRootFiles(@Param("driveId")String driveId);
	
	List<File> findByParentId(String parentId);
}
